import { Injectable } from "@angular/core";
import { Device } from "@ionic-native/device";
import { Platform } from "ionic-angular";

@Injectable()
export class DeviceService {
    constructor(private deviceNative: Device, private platform: Platform) {

    }

    public uuid(): string {
        if (!this.isOnCordova()) {
            return "mobileweb";
        }
        else {
            return this.deviceNative.uuid || "";
        }
    }

    public isOnCordova(): boolean {
        return this.platform.is('cordova');
    }
}
